<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get information about the current mailbox</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.imap-mail.html">« imap_mail</a></li>
      <li style="float: right;"><a href="function.imap-mime-header-decode.html">imap_mime_header_decode »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.imap.html">IMAP 函数</a></li>
    <li>Get information about the current mailbox</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.imap-mailboxmsginfo" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imap_mailboxmsginfo</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imap_mailboxmsginfo</span> &mdash; <span class="dc-title">Get information about the current mailbox</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imap-mailboxmsginfo-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imap_mailboxmsginfo</strong></span>(<span class="methodparam"><span class="type"><span class="type IMAP\Connection">IMAP\Connection</span></span> <code class="parameter">$imap</code></span>): <span class="type"><a href="class.stdclass.html" class="type stdClass">stdClass</a></span></div>

  <p class="para rdfs-comment">
   Checks the current mailbox status on the server. It is similar to
   <span class="function"><a href="function.imap-status.html" class="function">imap_status()</a></span>, but will additionally sum up the size of
   all messages in the mailbox, which will take some additional time to 
   execute. 
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imap-mailboxmsginfo-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    <dt>

<code class="parameter">imap</code></dt>
<dd>
<p class="para"><span class="classname"><strong class="classname">IMAP\Connection</strong></span> 实例。</p></dd>

   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imap-mailboxmsginfo-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the information in an object with following properties:
   <table class="doctable table">
    <caption><strong>Mailbox properties</strong></caption>
    
     <tbody class="tbody">
      <tr>
       <td>Date</td>
       <td>date of last change (current datetime)</td>
      </tr>

      <tr>
       <td>Driver</td>
       <td>driver</td>
      </tr>

      <tr>
       <td>Mailbox</td>
       <td>name of the mailbox</td>
      </tr>

      <tr>
       <td>Nmsgs</td>
       <td>number of messages</td>
      </tr>

      <tr>
       <td>Recent</td>
       <td>number of recent messages</td>
      </tr>

      <tr>
       <td>Unread</td>
       <td>number of unread messages</td>
      </tr>

      <tr>
       <td>Deleted</td>
       <td>number of deleted messages</td>
      </tr>

      <tr>
       <td>Size</td>
       <td>mailbox size</td>
      </tr>

     </tbody>
    
   </table>

  </p>
  <p class="para">
   Returns <strong><code>false</code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imap-mailboxmsginfo-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.1.0</td>
 <td>
  现在 <code class="parameter">imap</code> 参数接受 <span class="classname"><strong class="classname">IMAP\Connection</strong></span>
  实例，之前接受 <a href="language.types.resource.html" class="link">资源(resource)</a>。
 </td>
</tr>

    </tbody>
   
  </table>

 </div>

 
 <div class="refsect1 examples" id="refsect1-function.imap-mailboxmsginfo-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2996">
    <p><strong>示例 #1 <span class="function"><strong>imap_mailboxmsginfo()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$mbox&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imap_open</span><span style="color: #007700">(</span><span style="color: #DD0000">"{imap.example.org}INBOX"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;die(</span><span style="color: #DD0000">"can't&nbsp;connect:&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">imap_last_error</span><span style="color: #007700">());<br /><br /></span><span style="color: #0000BB">$check&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imap_mailboxmsginfo</span><span style="color: #007700">(</span><span style="color: #0000BB">$mbox</span><span style="color: #007700">);<br /><br />if&nbsp;(</span><span style="color: #0000BB">$check</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Date:&nbsp;"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$check</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Date&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;\n"&nbsp;</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Driver:&nbsp;"&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$check</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Driver&nbsp;&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;\n"&nbsp;</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Mailbox:&nbsp;"&nbsp;&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$check</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Mailbox&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;\n"&nbsp;</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Messages:&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$check</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Nmsgs&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;\n"&nbsp;</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Recent:&nbsp;"&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$check</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Recent&nbsp;&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;\n"&nbsp;</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Unread:&nbsp;"&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$check</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Unread&nbsp;&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;\n"&nbsp;</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Deleted:&nbsp;"&nbsp;&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$check</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Deleted&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;\n"&nbsp;</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Size:&nbsp;"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$check</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Size&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;\n"&nbsp;</span><span style="color: #007700">;<br />}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"imap_mailboxmsginfo()&nbsp;failed:&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">imap_last_error</span><span style="color: #007700">()&nbsp;.&nbsp;</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;\n"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">imap_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$mbox</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>

</div></div></div></body></html>